<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改车辆信息')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-vehicle-edit" th:object="${vehicleInfo}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">车牌号：</label>
                <div class="col-sm-8">
                    <input name="vehicleNumber" th:field="*{vehicleNumber}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">车辆品牌：</label>
                <div class="col-sm-8">
                    <input name="brand" th:field="*{brand}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">车辆型号：</label>
                <div class="col-sm-8">
                    <input name="model" th:field="*{model}" class="form-control" type="text">
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">车辆状态：</label>
                <div class="col-sm-8">
                    <div class="radio-box">
                        <input type="radio" name="status" th:value="1" th:checked="${vehicleInfo.status == 1}">
                        <label th:for="1" th:text="'待使用'"></label>
                    </div>
                    <div class="radio-box">
                        <input type="radio" name="status" th:value="2" th:checked="${vehicleInfo.status == 2}">
                        <label th:for="2" th:text="'已使用'"></label>
                    </div>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "system/vehicle";
        $("#form-vehicle-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-vehicle-edit').serialize());
            }
        }
    </script>
</body>
</html>